package com.hexacta.hrs.domain.feedback;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

import org.apache.poi.ss.formula.functions.T;

import com.hexacta.hrs.domain.feedback.skills.FeedbackSkillType;

import edu.emory.mathcs.backport.java.util.Collections;

public class FeedbackMentorSkill {
	
	private FeedbackSkillType feedbackSkillType;
	
	private List<FeedbackMentorsProsAndCons> feedbackMentorsProsAndCons = new ArrayList<FeedbackMentorsProsAndCons>();

	public FeedbackMentorSkill(FeedbackSkillType feedbackSkillType,
			List<FeedbackMentorsProsAndCons> feedbackMentorsProsAndCons) {
		super();
		this.feedbackSkillType = feedbackSkillType;
		this.feedbackMentorsProsAndCons = feedbackMentorsProsAndCons;
	}
	
	public FeedbackMentorSkill() {
	}

	public FeedbackSkillType getFeedbackSkillType() {
		return feedbackSkillType;
	}

	public void setFeedbackSkillType(FeedbackSkillType feedbackSkillType) {
		this.feedbackSkillType = feedbackSkillType;
	}

	public List<FeedbackMentorsProsAndCons> getFeedbackMentorsProsAndCons() {
		Collections.sort(feedbackMentorsProsAndCons, new Comparator<FeedbackMentorsProsAndCons>() {
			@Override
			public int compare(FeedbackMentorsProsAndCons o1,FeedbackMentorsProsAndCons o2) {
				return o1.getEvaluator().getPerson().getName().compareTo(o2.getEvaluator().getPerson().getName());
			}
		});
		Collections.sort(feedbackMentorsProsAndCons, new Comparator<FeedbackMentorsProsAndCons>() {
			@Override
			public int compare(FeedbackMentorsProsAndCons o1,FeedbackMentorsProsAndCons o2) {
				return o1.getProject().compareTo(o2.getProject());
			}
		});
		return feedbackMentorsProsAndCons;
	}

	public void setFeedbackMentorsProsAndCons(
			List<FeedbackMentorsProsAndCons> feedbackMentorsProsAndCons) {
		this.feedbackMentorsProsAndCons = feedbackMentorsProsAndCons;
	}
	
	public void addFeedbackMentorsProsAndCons(FeedbackMentorsProsAndCons feedbackMentorsProsAndCons){
		this.feedbackMentorsProsAndCons.add(feedbackMentorsProsAndCons);
	}
	
}
